Learning Objectives

After completing this lesson, you’ll be able to:

Note

Learning content in the FME Academy presents a user story that addresses their data integration challenges with FME. You should follow along with their actions using your FME installation (2026.1 or later) or request an on-demand virtual machine. Some lessons will require you to follow their steps or take additional steps to answer a quiz question.

The Resources section will provide links to interactive tutorials and starting workspaces when necessary.

Instructions

In this lesson, you will:

Resources

Scenario

Jennifer

Jennifer has successfully retreived JSON from an API. However, it's currently stored as a JSON document in an attribute on a feature. She needs to turn the JSON text into FME features with attributes. She'll use a JSON transformer for this task.

1) Open Starting Workspace

2) Add a JSONFragmenter

Adding a JSONFragmenter

 

Source > JSON Attribute _response_body
Flattening > Flatten Query Result into Attributes Yes

Configuring the JSONFragmenter

With these settings, the JSONFragmenter will split each JSON array entry into an FME feature. Then it will "flatten" the JSON's nested structure into the columnar structure of FME attributes.

However, if we use only these settings, the resulting attributes will be unexposed; they will not appear in the Table view or be accessible in the workspace. This is because FME is designed to work with a fixed schema. It is not known in advance what names these attributes will have, because the JSON could contain anything. So we have to expose the attributes we expect.

Exposing attributes can be done with the Attributes to Expose parameter in the JSONFragmenter, but we can use the attributes stored in the data cache if we uses an AttributeExposer transformer instead.

3) Add an AttributeExposer

Added an AttributeExposer

An Import from Data Cache dialog appears. By default, all the attributes found in the cache are selected for exposing. 

Import from Data Cache

AttributeExposer added

4) Test the JSONFragmenter

Let's test if we configured the transformer correctly.

We successfully read the web data and extracted the attributes.

In the next lesson, we'll generate geometry from coordinates and write the data to a geodatabase.

Optional Challenge: Integrate with Generative AI

Note

This is an optional section. The changes Jennifer makes to the workspace won't carry over to the next lesson.

To learn more about AI features in FME, check out this blog post. You can also download our AI security whitepaper.

Jennifer would like to generate a short text summary of each business for use in the city's annual business license renewal emails. She doesn't want to write one for every feature, so this is a good use case for generative AI using a large language model.

1) Add a Sampler

Added a Sampler

Sampler configuration

2) Add an OpenAIConnector

At this point, we could use another HTTPCaller to call the OpenAI API, but someone has already created an FME custom transformer that makes this process even easier. We can quickly download it from the FME Hub and use it in our workspace. Because FME is the all-data, any-AI platform, we could connect to any AI provider she wished via API. We chose OpenAI because we are familiar with their platform.

Installing a custom transformer from the FME Hub

Added an OpenAIConnector

You are an employee working for a city's Business License department. Your tone should be professional, friendly, and to the point.

Please generate a 2-sentence summary of the following business.

Here are the details:

Company Name: @Value(Company)

Business License Number: @Value(License Number)

Business Owner Name: @Value(First) @Value(Last Name)

Business Location: @Value(Latitude), @Value(Longitude)

Please only return the summary address in your response; provide no extra text or formatting.

3) Test AI Integration

Hendrerit Consectetuer Cursus Industries, owned by Garth Garrett, operates under business license number 8BCB7F. The business is located at coordinates 49.24906160267, -123.1006079306.

It's pretty basic, but it will save her time from having to write it herself. If she adds more business information in the future, she could ask the assistant to add more detail or conduct other tasks like classifying business into NAICS codes or flagging business with potentially incorrect attribute values.

Learn More